#ProNOIobjects.py

import wx
import math

class object:
    def __init__(self, otype):
        self.objtype = otype
        self.fill = self.surface
        self.charge = 0
        self.radius = 0
        self.residue = 'NIL'
        self.atom = 'OBJ'
        self.precision = 1.0
        
        
    @classmethod
    def initEllipsoid(cls, X, Y, A, B, T):
        retval = cls(cls.ellipsoid)
        retval.x = X
        retval.y = Y
        retval.a = A
        retval.b = B
        retval.theta = T
        return retval
        
    @classmethod
    def initTube(cls, W, TEN, BIAS):
        retval = cls(cls.tube)
        retval.width = W
        retval.tension = TEN
        retval.bias = BIAS
        retval.ctrlpts = list()
        retval.points = list()
        return retval
        
    ellipsoid, tube = range(2)
    surface, solid = range(2)
    
    def GetFillStr(self):
        retval = ''
        if (self.fill == self.surface):
            retval = ' -surface '
        elif(self.fill == self.solid):
            retval = ' -solid '
        return retval
    def IsSolid(self):
        retval = self.fill == self.solid
        return retval
        
def ScalePoints(scale, lst):
    retval = list()
    for pt in lst:
        retval.append((pt[0]*scale[0], pt[1]*scale[1]))
    return retval
